<?php

class BaseModule extends CWebModule
{
    public $access = null;
    
    public function init()
    {
        $this->setModuleThemeViews();
    }
    
    public function setModuleThemeViews()
    {
        if ( !$this->layout )
        {
            $this->layout = 'main';
        }
        
        $moduleName     = $this->id;
        $this->viewPath = Yii::getPathOfAlias('webroot').'/themes/'.Yii::app()->theme->getName().'/templates/modules/'.$moduleName.'/actions';

        Yii::app()->themeManager->baseUrl = '/themes';
        Yii::app()->themeManager->basePath = Yii::getPathOfAlias('webroot').'/themes';
    }
}